package com.alibaba.citrus.ots.platform.enhance.sdo;

import lombok.Getter;
import lombok.Setter;

import java.util.Arrays;

/**
 * @author zhoubc
 * @description: TODO
 * @date 2021/9/13 21:23
 */
public enum OrganizationBizTypeEnum {

    COMPANY("COMPANY","公司");

    @Getter
    @Setter
    private String code;

    @Getter
    @Setter
    private String desc;

    OrganizationBizTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static OrganizationBizTypeEnum of(Integer code) {
        if (code == null) {
            return null;
        }
        return Arrays.stream(OrganizationBizTypeEnum.values()).filter(source -> code.equals(source.code)).findFirst().orElse(null);
    }


}
